package ui 
{
	import Base.Loader.SWFLoader;
	
	import Common.RenderManager;
	
	import logic.GameItem;

	/**
	 * ...
	 * @author 
	 */
	public class BattleResultUIHandler extends uiBase
	{
		public function BattleResultUIHandler() 
		{
			path = "battleResult.swf";
			name = "BattleResultUI";
			
		}
		
		public override function onInit( loader:SWFLoader ):void
		{
			isVisible = false;
			
			super.onInit( loader );
		}
		
		
		public function show():void
		{
			uiMc.show();
		}
		
		public function addText( name:String , exp:int , b:Boolean ):void
		{
			if ( uiMc )
				uiMc.addText( name , exp , b );
		}
		
		public function clear():void
		{
			if ( uiMc )
			{
				uiMc.clear();
			}
		}
		
		public function addItem( item:GameItem ):void
		{
			if ( uiMc )
			{
				uiMc.addItem( item.id , item.name );
			}
		}
		
		public function visibleItem():void
		{
			if ( uiMc )
			{
				uiMc.visibleItem();
			}
		}
		
		public static var instance:BattleResultUIHandler = null;
		public static function Instance():BattleResultUIHandler
		{
			if ( instance == null )
			{
				instance = new BattleResultUIHandler();
			}
			
			return instance;
		}
		
		
		public override function resize():void
		{
			if ( uiMc )
			{
				uiMc.x = RenderManager.instance.stageWidth * 0.5;
				uiMc.y = RenderManager.instance.stageHeight * 0.5;
			}
		}
		
	}

}